home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / CPP / WCLASS95.ZIP / MICROSFT.TXT < prev    next >
Encoding:
Text File  |  1995-07-29  |  4.1 KB  |  89 lines

  1. Generating C++ for Microsoft Visual C++
  2.  
  3. 1. Microsoft Visual C++ 1.5 with QuickWin - Getting Started Visual C++ Script
  4.  
  5. Class Diagram: vc15car.omt
  6. Script Files: vc15head.sct and vc15func.sct - also vc15hd1.sct and vc15fu1.sct with vc15mai1.cpp
  7. Main File: vc15main.cpp
  8.  
  9. The easiest way to use With Class and Visual C++ is to create a QuickWin project.  This will permit the use of
  10. the C++ iostream objects, e.g. cin and cout.  The steps to generate Microsoft Visual C++ 1.5 code with
  11. QuickWin and to compile the generated files are as follows:
  12.  
  13. >> Launch With Class from Windows
  14. >> Open cppcar.omt
  15. >> Double click on the Tire and Passenger classes to add the following in the Library Base Class box
  16.  : public CObject.  These are on the 1 : Many side.  The objects are elements of CObList and CPtrList
  17. Collection classes
  18. >> Select "Generate - Generate Class Code"
  19. >> Select h as the file extension
  20. >> Select vc15head.sct to generate the header files (.h)
  21. >> Select "Generate - Generate Class Code"
  22. >> Select cpp as the file extension
  23. >> Select vc15func.sct to generate the source code files (.cpp)
  24. >> Select "File - Edit File" to examine the generated files, e.g. car.h
  25. >> Run Visual C++ environment
  26. >> Create QuickWin Car Project, e.g. carproj.mak and select "Use Microsoft Foundation Classes"
  27. >> Add the .cpp files to the project
  28. >> Compile all .cpp files
  29. >> Compile vc15main.cpp
  30. >> Execute the project
  31.  
  32. Notes for Visual C++ 1.5. To use iostream.h then create a VC15 QuickWin project.  Create a VC15 QuickWin
  33. project with vc15main.cpp.  Add the following files to the project: vehicle.cpp, car.cpp, cellular.cpp,
  34. passenge.cpp, tire.cpp, motor.cpp, and vc15main.cpp.
  35.  
  36. Select "Options Project Linker
  37. Miscellaneous" and enter /NOE.  Select "Options Project
  38. Linker Windows-Library" and select COMMDLG and SHELL.
  39.  
  40. Copy stdafx.h and stdafx.cpp into your directory.
  41.  
  42. This script uses CPtrList ASSOCIATION_MANY_NAME and CObList AGGREGATION_MANY_NAME for 1 to
  43. Many Relationships.  For your highest base class of any class whose objects are elements of the CObList or
  44. CPtrList collection classes, enter : public Cobject in the Class Specification Library Base Class.
  45.  
  46. For Visual C++ 2.0 1 : Many relationships substitute a template collection class for the CObList and CPtrList
  47. such CList<Passenger>.
  48.  
  49. 2.  Microsoft Visual C++ 1.5 for a Windows Application - Getting Started Visual C++ Script
  50.  
  51. Class Diagram: vc15car.omt
  52. Script Files: vc15hdex.sct and vc15fuex.sct
  53. Main File: N/A
  54.  
  55. The steps to generate Microsoft Visual C++ 1.5 code for a Windows EXE and to compile the generated files are
  56. as follows:
  57.  
  58. >> Launch With Class from Windows
  59. >> Open vc15car.omt
  60. >> Double click on the Tire and Passenger classes to add the following in the Library Base Class box
  61.  : public CObject.  These are on the 1 : Many side.  The objects are elements of CObList and CPtrList
  62. Collection classes.
  63. >> Select "Generate - Generate Class Code"
  64. >> Select h as the file extension
  65. >> Select vc15hdex.sct to generate the header files (.h)
  66. >> Select "Generate - Generate Class Code"
  67. >> Select cpp as the file extension
  68. >> Select vc15fuex.sct to generate the source code files (.cpp)
  69. >> Select "File - Edit File" to examine the generated files, e.g. car.h
  70. >> Run Visual C++ environment
  71. >> Select "App Expert"
  72. >> Create Windows Application Car Project, e.g. XXX.mak
  73. >> Add the .cpp files to the project
  74. >> Select "File - Open" XXXdoc.h file to add #include "car.h" as an include file and add Car car1; as a data
  75. member
  76. >> Compile all .cpp files
  77. >> Update the XXXdoc with functions to invoke the car functions
  78. >> Execute the project
  79.  
  80. Note:  This script uses CPtrList ASSOCIATION_MANY_NAME and CObList AGGREGATION_MANY_NAME
  81. for 1 to Many Relationships.  For your highest base class of any class whose objects are elements of the
  82. CObList or CPtrList collection classes, enter : public CObject in the Class Specification Library Base Class.
  83.  
  84. For Visual C++ 2.0 1 to Many relationships substitute a template collection class for the CObList such
  85. CList<Passenger>.
  86.  
  87. Please send comments to Richard Felsinger 71162,755@compuserve.com telephone 803-881-3648.
  88.  
  89.